<?php

use App\Http\Controllers\UserController;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/


$app->get('/', function () use ($app) {
    return $app->version();

});



$app->get('/updatedate','TestController@updatedate');				            //   账户详情


$app->group(['prefix' => 'api/v1'], function($app){
	
	//User 用户相关操作
	$app->group(['prefix' => 'user'], function($app){
		$app->post('register','UserController@createUser'); 		//注册
		$app->post('login','UserController@login'); 				//登录
		$app->post('logout','UserController@logout');				//注销
		$app->post('modify','UserController@modify');				//修改信息
		$app->post('modify/password','UserController@modifyPassword');
// 		$app->delete('user/{id}','UserController@deleteUser');
		$app->get('info/{token}','UserController@info');
		$app->get('vip/{token}','UserController@vip');
		$app->post('test','UserController@test');
//		$app->post('heartBeat','UserController@heartBeat'); //心跳包

		$app->post('heartBeat','UserController@updateHeartBeatData'); //心跳包

		$app->get('clearheartbeat','UserController@clearHeartBeat'); //清除心跳
	});

	//服务器
	$app->group(['prefix' => 'line'], function($app){
		$app->post('list','LineController@get');
		$app->post('account','AccountController@get');
		$app->post('create','LineController@create');
	});
	
	//版本检查
	$app->get('version/check/{no}','VersionController@check');
	

	
});

$app->group(['namespace'=>'Radius'],function() use ($app){

	$app->post('/radius/V1/login','UserController@login');                           		//    用户登录
	$app->get('/radius/V1/logout','UserController@logout');                         		//    用户退出

	$app->post('/radius/V1/accountlist','UserController@getAccountList');                  	//   获取用户列表

	$app->post('radius/V1/createuser','UserController@createUser');                  		//   创建用户

	$app->post('/radius/V1/addacouunt','UserController@addAcouunt');                		//   添加账号
	$app->post('/radius/V1/updateaccount','UserController@updateAcouunt');          		//   修改账号信息
	$app->get('/radius/V1/getaccountonlineinfo','UserController@getAccountOnlineInfo');     //   获取账号在线信息
	$app->get('/radius/V1/forbiddenaccount','UserController@forbiddenAccount');          	//   账号禁用
	$app->post('/radius/V1/getaccountbilllist','UserController@getBillList');          		//   用户账单列表
	$app->get('/radius/V1/getonlinelist','UserController@getOnlineList');          			//   用户账单列表

	$app->post('/radius/V1/deleteaccount','UserController@deleteAccountLine');          		//   用户账单列表
	$app->get('/radius/V1/getuserinfo','UserController@getUserInfo');          				//   用户账单列表
	$app->get('/radius/V1/checkusername','UserController@checkUserName');          		    //   检测用户名
	$app->post('/radius/V1/renewaccount','UserController@renewaccount');          		    //   账户续费
//	$app->post('/radius/V1/renewaccount','UserController@renewaccount');          		    //   账户续费
	$app->get('/radius/V1/limitspeed','UserController@limitSpeed');          		    	//   账户续费
	$app->get('/radius/V1/getip','TestController@getIp');          		    			//   批量续费


	$app->get('/radius/V1/updateline','CrontabController@updateLinelist');							//   更新线路列表
	$app->get('/radius/V1/updateuserbalance','CrontabController@updateUserBalance');				//   更新用户约

	$app->get('/radius/V1/deleteexpiredaccount','CrontabController@deleteExpiredAccount');			//   删除过期用户数据

    $app->get('/radius/V1/update','UserController@updateData');          		    				//   平台数据更新
	$app->post('/radius/V1/batchrenew','BatchController@batchRenew');          		    			//   批量续费

	$app->post('/radius/V1/batchadd','BatchController@batchAdd');          		    								//   批量续费

	$app->post('/radius/V1/manageuserlist','TestController@ManageUserList');          		    					//   批量续费

	$app->get('/radius/V1/getOnlineTeam','OnlineTeamController@getOnlineTeam');          		    					//   在线客服列表
	$app->get('/radius/V1/getOnlineTeamUpdate','OnlineTeamController@getOnlineTeamUpdate');          		    		//   在线客服列表
	$app->post('/radius/V1/onlineupdateAaccount','OnlineTeamController@onlineTeamUpdateUserInfo');          		    //   在线客服账号信息修改
	$app->post('/radius/V1/onlinedeleteAaccount','OnlineTeamController@onlineTeamDeleteUserInfo');          		    //   在线客服账号信息删除
	$app->post('/radius/V1/onlineaddAaccount','OnlineTeamController@onlineTeamAdd');          		    				//   在线客服账号信息添加
	$app->get('/radius/V1/onlineteamdatalist','OnlineTeamController@getOnlineTeamDataList');          		    		//   在线客服账号数据列表
	$app->get('/radius/V1/onlineteamuserinfo','OnlineTeamController@getOnlineTeamUserInfoDataList');          		    //   在线客服账号数据列表
	$app->get('/radius/V1/submitAudit','OnlineTeamController@doSubmitAudit');          		    						//   管理员提交审核
	$app->post('/radius/V1/addaudit','OnlineTeamController@doAddAudit');
	$app->post('/radius/V1/auditdelete','OnlineTeamController@doAuditDelete');



	$app->post('/radius/V1/getmanageinfo','UserController@getManageInfo');											//  管理员优惠列表

	$app->post('/radius/V1/getadminlist','AdminController@getAdminList');
	$app->post('/radius/V1/adminupdate','AdminController@doAdminUpdate');
	$app->post('/radius/V1/admin/recharge','AdminController@doAdminRecharge');
	$app->post('/radius/V1/admin/delete','AdminController@doAdminDelete');
	$app->post('/radius/V1/admin/add','AdminController@doAdminAdd');
	$app->post('/radius/V1/admin/deduct','AdminController@ADMIN');

	$app->get('/radius/V1/test/updateAccountStatus','TestController@updateAccountType');

	$app->post('/radius/V1/code/add','ModuleController@pullCode');
	$app->post('/radius/V1/code/get','ModuleController@getCode');


	$app->get('/radius/V1/batch/renew','TestController@bachrenew');
	$app->get('/radius/V1/batch/delete','TestController@bachdelete');



    $app->post('/radius/V1/region/list','RegionLineController@getRegionLineList');              //   地区列表
    $app->post('/radius/V1/region/modify','RegionLineController@modifyRegionLine');             //   线路下线
    $app->post('/radius/V1/region/add','RegionLineController@AddRegionLine');             //   添加线路
    $app->post('/radius/V1/region/remove','RegionLineController@RemoveRegionLine');             //   添加线路



    //   美团
    $app->post('/radius/V1/meituan/region/list','MeiTuanController@getRegionLineList');              //   地区列表
    $app->post('/radius/V1/meituan/region/modify','MeiTuanController@modifyRegionLine');             //   线路下线
    $app->post('/radius/V1/meituan/region/add','MeiTuanController@AddRegionLine');             //   添加线路
    $app->post('/radius/V1/meituan/region/remove','MeiTuanController@RemoveRegionLine');             //   添加线路



    //   刘工
    $app->post('/radius/V1/liu/region/list','LiuGongController@getRegionLineList');              //   地区列表
    $app->post('/radius/V1/liu/region/modify','LiuGongController@modifyRegionLine');             //   线路下线
    $app->post('/radius/V1/liu/region/add','LiuGongController@AddRegionLine');             //   添加线路
    $app->post('/radius/V1/liu/region/remove','LiuGongController@RemoveRegionLine');             //   添加线路


    // 推广平台
    $app->post('/radius/V1/tuiguang/platform/list','TuiGuangController@getPlatFormListData');             //   推广平台添加
    $app->post('/radius/V1/tuiguang/platform/add','TuiGuangController@doPlatformAdd');             //   推广平台添加
    $app->post('/radius/V1/tuiguang/platform/modify','TuiGuangController@doPlatFormModify');             //   推广平台修改
    $app->post('/radius/V1/tuiguang/platform/delete','TuiGuangController@doPlatFormDelete');             //   推广平台修改

    //  推广计划
    $app->post('/radius/V1/tuiguang/plan/add','TuiGuangController@addExtensionPlan');                   //   添加平台推广计划
    $app->post('/radius/V1/tuiguang/plan/modify','TuiGuangController@doExtensionPlanModify');           //   修改平台推广计划
    $app->post('/radius/V1/tuiguang/plan/del','TuiGuangController@doExtensionPlanDelete');              //   删除平台推广计划
    $app->post('/radius/V1/tuiguang/plan/list','TuiGuangController@getPlanListData');                   //   获取平台下推广计划


    //  推广计划关键词
    $app->post('/radius/V1/tuiguang/keyword/add','TuiGuangController@doKeyWordAdd');                    //   添加推广计划关键词
    $app->post('/radius/V1/tuiguang/keyword/data','TuiGuangController@getKeyWordListData');             //   获取推广计划关键词数据
    $app->post('/radius/V1/tuiguang/keyword/update','TuiGuangController@doKeyWordUpdate');              //   获取推广计划关键词数据

    // 推广数据
    $app->post('/radius/V1/tuiguang/extension/data','TuiGuangController@getExtensionData');              //   获取推广数据
    $app->post('/radius/V1/tuiguang/extension/download','TuiGuangController@downloadExtensionData');     //   获取推广数据下载



//    /radius/V1/tuiguang/keyword/add


    $app->post('/radius/V1/manage/order/recode','AdminController@getManageOrderRecodeData');             //   管理员账单记录数据
    $app->post('/radius/V1/manage/get/serialnumber','AdminController@getSerialNumber');                  //   获取流水号

    $app->post('/radius/V1/check/admin/status','AdminController@getAdminStatus');                        // 检测管理员状态

    //   充值
    $app->post('/radius/V1/super/admin/list','AdminController@getSuperAdminList');                        // 检测管理员状态

    $app->post('/radius/V1/meituan/line/list','RegionLineController@getMeiTuanRegionLineList');                        // 检测管理员状态

    //   微信公众号 绑定赠送时长
    $app->get('/radius/V1/Wechat/bind','WechatPublicNumberController@bindUserWechat');



});



//   安卓 接口
$app->group(['namespace'=>'mobile'],function() use ($app){

	$app->post('/mobile/v1/register','UserController@createUser');							//   手机注册
	$app->post('/mobile/v1/login','UserController@login');									//   手机登录
	$app->post('/mobile/v1/getarealist','UserController@getAreaList');						//   手机获取地区列表
	$app->post('/mobile/v1/getproductlist','UserController@getProductList');				//   手机端获取产品列表
	$app->post('/mobile/v1/createorder','UserController@createdOrder');						//   手机端生成订单
	$app->post('/mobile/v1/alipayback','UserController@aliPayBack');						//   手机端生成订单
	$app->post('/mobile/v1/getorderlist','UserController@getOrderList');				    //   手机端获取定单列表
	$app->post('/mobile/v1/removeorder','UserController@doOrderDelete');				    //   手机端获取定单列表
	$app->post('/mobile/v1/logout','UserController@logout');				    			//   手机端退出
	$app->post('/mobile/v1/version','UserController@CheckVersion');				    		//   手机端检测版本
	$app->post('/mobile/v1/checkconnect','UserController@CheckConnectNum');				    //   手机端检测连接数
});



//版本号V1
	$app->group(['prefix' => 'v1'], function($app){
	
		//User 用户相关操作
		$app->group(['prefix' => 'user'], function($app){
			$app->post('register','UserController@createUser'); 		//注册
			$app->post('login','UserController@login'); 				//登录

			$app->post('logout','UserController@logout');				//注销
			$app->post('modify','UserController@modify');					//修改信息
			$app->post('modify/password','UserController@modifyPassword');
			// 		$app->delete('user/{id}','UserController@deleteUser');

			$app->get('info/{token}','UserController@info');
			$app->get('web_user_info','UserController@getWebUserInfo');
			$app->get('get_code','VerifyCodeController@get');			//  获取验证码
			$app->get('vip/{token}','UserController@vip');
			$app->post('test','UserController@test');
			$app->post('heartBeat','UserController@updateHeartBeatData'); //心跳包
			$app->get('clearheartbeat','UserController@clearHeartBeat'); //清除心跳
			$app->get('kefuqq','UserController@KeFuqq'); //清除心跳
			$app->get('getTeamqq','UserController@getTeamqq'); //清除心跳
		   $app->post('weblogin','UserWebController@login'); 				//登录
		   $app->post('weblogout','UserWebController@logout'); 				//注销

		   $app->get('bind/phone','UserWebController@bindPhone'); 				//绑定手机号
		   $app->get('bind/qq','UserWebController@updateQQ'); 					//绑定qq号
		   $app->get('update/email','UserWebController@updateEmail'); 				//绑定邮箱

		   $app->post('updatePassword','UserWebController@updatePassword'); 				//修改密码

			$app->get('accountGetUserId','UserWebController@accountGetUserId'); 		//  用户名获取用户ID
			$app->get('discountCoupon','UserWebController@discountCoupon'); 			//  优惠券优惠


			$app->get('order/list','OrderController@getOrderList'); 				//获取订单列表
		   $app->get('createorder','OrderController@createAliPayOrder'); 				//获取订单列表
		   $app->get('product','ProductController@getProductList'); 				//获取产品列表
		   $app->get('product/info','ProductController@getProductInfo'); 				//获取产品详情


		   $app->get('pay','PayController@SlingAliPay'); 					   //调起阿里支付
		   $app->post('paycallback','AliPay\AliPayNotifyController@PayCallback'); 					   //服务器异步通知页面
            $app->post('wxpay','PayController@SlingWxPay'); 					                            //调起微信支付


            $app->post('wechatpaycallback','Wxpay\WxPayNotifyController@PayCallback'); 					   //微信支付异步通知
            $app->post('wxpayorderstatus','Wxpay\WxPayController@CheckWxPayOrderStatus'); 				  //检测微信订单状态


			$app->get('submitnotice','NoticeController@InsetNotice'); 					//添加公告
			$app->get('getnoticelist','NoticeController@getNoticeList'); 				//获取公告列表
			$app->get('getarealist','Radius\UserController@getAreaList'); 				//获取地区线路列表

            $app->post('linelist','LineController@getServiceLines'); 				//获取地区线路列表
            $app->post('line/list','LineController@getServiceLinesV2'); 				//获取地区线路列表

            $app->get('getorderlist','RechargeController@getOrderList'); 				//获取订单列表

			//代理
			$app->get('/getorderno','OrderController@getOrderNo'); 				//获取订单号;
			$app->get('/sendsms','VerifyCodeController@sendSMS'); 				//获取订单号;


			$app->get('updatequota','Radius\CrontabController@updateAccountQuota');			//  更新管理员账户配额
            $app->get('clearradacct','Radius\CrontabController@clearRadacct');			//


		});


		//代理
		$app->group(['prefix' => 'agent'], function($app){
			$app->post('login','AgentController@agentLogin');				//   代理登录
			$app->post('addUser','AgentController@addAgentUser');				//   代理登录
			$app->get('getConsumptionRecord','AgentController@getConsumptionRecord');				//   开户记录列表
			$app->get('getAccountNumber','AgentController@getAccountNumber');				//   获取账户列表
			$app->get('agentinfo','AgentController@userInfo');				//   获取账户列表
			$app->get('productList','AgentController@productList'); 				//获取产品列表
			$app->get('getUserInfo','AgentController@getUserInfo'); 				//获取产品列表
			$app->post('renewVip','AgentController@renewVip'); 				//续费
		});



		//服务器
		$app->group(['prefix' => 'line'], function($app){
			$app->post('get','LineController@getlines');
			$app->post('list','LineController@get');
			$app->post('account','AccountController@get');
			$app->post('create','LineController@create');
			$app->post('ipaddress','LineController@getLinesIpAddress');
			$app->post('create','LineController@create');
			$app->post('ipaddress/list','LineController@getIPlistData');
		});

		//  推广添加
        $app->group(['prefix' => 'statictis'], function($app){
            $app->post('add','Radius\TuiGuangController@addStatictis');

        });


		//版本检查
		$app->get('version/check/{no}','VersionController@check');
		
		//检测清理
		$app->get('monitor/show/{key}','MonitorController@index');
		$app->get('monitor/recovery/{key}','MonitorController@recovery');
	
	});

$app->get('get/server/status','TestController@pingAddress');







$app->group(['namespace'=>'Agent'],function() use ($app){

    $app->group(['prefix' => '/v1/agent'], function($app){
        $app->post('/register','AgentController@InviteAgentRegister');							    //   诚邀代理注册

    });
    $app->group(['prefix' => '/admin/V1'], function($app){

        $app->post('/wx/recharge','RechargeController@WxRecharge');             //   微信充值
        $app->post('/ali/recharge','RechargeController@AliRecharge');             //   支付宝充值
        $app->post('/check/recharge/status','RechargeController@CheckRechargeStatus');             //   支付宝充值

    });


});






    //  HTTP代理
$app->group(['namespace'=>'HttpAgent'],function() use ($app){
    $app->group(['prefix' => '/v1/http/agent/ip'], function($app){
        $app->post('/add','HttpAgentController@addHttpAgentIpListData');
    });
});







$app->group(['namespace'=>'External'],function() use ($app){
    $app->group(['prefix' => 'external/v1'], function($app){
        $app->get('address/list','ExternalController@geExternalLineList');	    									// 外部提供接口线路列表					//	检测订单号
        $app->get('server/{region}/list','ExternalController@geExternalRegionLineList');	    					// 外部提供接口线路列表					//	检测订单号
        $app->post('line/list','ExternalController@geExternalLineListV2');	    									// 外部提供接口线路列表2					//	检测订单号
        $app->get('area/list','ExternalController@geExternalMeiTuanLineList');	    							    // 美团  接口					//	检测订单号
    });

});



























